package com.paul.inventoryitem.dao;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import com.paul.inventoryitem.valueobject.InventoryItem;

@Stateless
public class InventoryItemCombineDao {
	
	@EJB
	private InventoryItemDao inventoryItemDao1;
	
	@EJB
	private InventoryItemDao2 inventoryItemDao2;
	
	/**
	 * This is a stateless session bean, by default a transaction 
	 * will be assigned,
	 * the transaction begin before the method start 
	 * and commit after the method exits.
	 * 
	 * @param inventoryItem
	 */
	public void testTraction(InventoryItem inventoryItem)
	{
		inventoryItemDao1.createWithoutException(inventoryItem);
		inventoryItemDao2.createWithException(inventoryItem.clone());
	}

}
